home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / mui / bcc_src.lha / Parser / test / MyApplication.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-28  |  1.4 KB  |  69 lines

  1. /* MyApplication class */
  2.  
  3. #include "MyApplication.h"
  4.  
  5. /* ---------------------------------------------- */
  6. /* BCC header. Inserted into every generated file */
  7. /* ---------------------------------------------- */
  8.  
  9. #ifndef _BCC_EVERY
  10. #define _BCC_EVERY
  11.  
  12. /* Includes necessary for every mui c code */
  13.  
  14. #include <proto/exec.h>
  15. #include <proto/muimaster.h>
  16. #include <libraries/mui.h>
  17.  
  18. #include <mui/muiextra.h>
  19.  
  20. #include <string.h>
  21.  
  22. /* defines that help adjusting to any compiler */
  23.  
  24. #ifdef _DCC
  25.     #define REG(x) __ ## x
  26.     #define ASM
  27.     #define SAVEDS __geta4
  28. #else
  29.     #define REG(x) register __ ## x
  30.  
  31.     #ifdef _STORM
  32.  
  33.             #define ASM
  34.             #define SAVEDS __saveds
  35.  
  36.     #else
  37.  
  38.         #if defined __MAXON__ || defined __GNUC__
  39.             #define ASM
  40.             #define SAVEDS
  41.         #else
  42.             #define ASM    __asm
  43.             #define SAVEDS __saveds
  44.         #endif
  45.     
  46.     #endif
  47.  
  48. #endif
  49.  
  50. #define CallSuper() DoSuperMethodA(cl, obj, msg)
  51. #define value (tag->ti_Data)
  52. #define GetData() INST_DATA(cl, obj)
  53.  
  54. #endif
  55. mMyApplicationOM_NEW( struct IClass *cl, Object *obj, Msg msg );
  56.  
  57. static unsigned long SAVEDS ASM MyApplication_Dispatcher( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg )
  58. {
  59.     switch( msg->MethodID ) {
  60.         case OM_NEW: return mMyApplicationOM_NEW( cl, obj, msg );
  61.     }
  62.     return( DoSuperMethodA( cl, obj, msg ) );
  63. }
  64.  
  65. struct MUI_CustomClass *MyApplication_Create( void )
  66. {
  67.     return MUI_CreateCustomClass( NULL, MUIC_Application, NULL, sizeof( MyApplicationData ), MyApplication_Dispatcher );
  68. }
  69.